package com.tencreat.mapper.mall;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tencreat.common.core.domain.entity.MallMessage;
import com.tencreat.domain.mall.MallMessageRecord;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;

/**
 * 消息记录Mapper接口
 *
 * @author tencreat
 * @date 2021-11-24
 */
public interface MallMessageRecordMapper extends BaseMapper<MallMessageRecord> {

    /**
     * 获取所有消息，默认分页10条
     * @param userId 用户ID app端使用uuid  平台使用id
     * @param page 分页参数
     * @param time 查询时间
     * @return 结果
     */
    Page<MallMessage> pageMessage(Page page, @Param("userId") Long userId, @Param("time") LocalDateTime time);

    Page<MallMessageRecord> appMessage(Page page, @Param("userId") Long userId);
}
